<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="Css/bootstrap.css" />
<link rel="stylesheet" type="text/css"
	href="Css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="Css/style.css" />
<script type="text/javascript" src="Js/jquery.js"></script>
<script type="text/javascript" src="Js/jquery.sorted.js"></script>
<script type="text/javascript" src="Js/bootstrap.js"></script>
<script type="text/javascript" src="Js/ckform.js"></script>
<script type="text/javascript" src="Js/common.js"></script>

<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}

@media ( max-width : 980px) {
	/* Enable use of floated navbar text */
	.navbar-text.pull-right {
		float: none;
		padding-left: 5px;
		padding-right: 5px;
	}
}
</style>
</head>
<body>
	<!--在表单中,名字一样的其value或HTML会被封装成一个相同名字的数组到跳转位置,如果是CheckBox,则只会封装被选中的元素的value.如果是input text之类的则直接封装的是value  -->
	<form action="change?isok=${isok }" method="post" class="definewidth m20">
		<table class="table table-bordered table-hover definewidth m10">
			<tr>
				<td width="10%" class="tableleft"><font color="red">*</font>角色名称</td>
				<td><input type="text" name="title" value="${name }" /></td>
			</tr>
			<tr>
				<td class="tableleft"><font color="red">*</font>状态</td>
				<td><input type="radio" name="status" value="1" checked /> 启用
					<input type="radio" name="status" value="0" /> 禁用</td>
			</tr>
			<tr>
				<td class="tableleft"><font color="red">*</font>权限</td>
				<td><c:forEach var="p" items="${list2}">
						<c:if test="${p.menuState==1 }">
							<ul>
								<label class='checkbox inline'><input type='checkbox'
									name='group' value='${p.menuId }' checked="checked" />${p.menuName }</label>
							</ul>
						</c:if>
						<c:if test="${p.menuState==0 }">
							<ul>
								<label class='checkbox inline'><input type='checkbox'
									name='group' value='${p.menuId }' />${p.menuName }</label>
							</ul>
						</c:if>

					</c:forEach></td>

			</tr>
			<tr>
				<td class="tableleft"></td>
				<td>
					<button type="submit" class="btn btn-primary" type="button">更新</button>
					&nbsp;&nbsp;
					<button type="button" class="btn btn-success" name="backid"
						id="backid">返回列表</button>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
<script>
	$(function() {
		$(':checkbox[name="group[]"]').click(
				function() {
					$(':checkbox', $(this).closest('li')).prop('checked',
							this.checked);
				});

		$('#backid').click(function() {
			window.location.href = "index.html";
		});

	});
</script>